package BizLogic;

import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;

import model.BookingDTO;
import dao.BookingDAO;
import dao.DAOFactory;



public class MonthlyUsageManager {
private BookingDAO bookingDAO;
	
	public MonthlyUsageManager(){
		
		bookingDAO = DAOFactory.loadInstance().getBookingDAO();
	}
	
	public ArrayList<BookingDTO> findAllBooking(){
		ArrayList<BookingDTO> bkAll=null;
		try {
			bkAll=bookingDAO.findAllBooking();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return bkAll;
	}
	
	public ArrayList<BookingDTO> MonthlyUsage(Date d1,Date d2)
	{
		ArrayList<BookingDTO> monthlyUsage=null;
		try {
			monthlyUsage=bookingDAO.ViewMonthlyUsage(d1, d2);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return monthlyUsage;
	}
}
